#pragma once
#include "WorkThread.h"
#include<stdbool.h>
#include <stdlib.h>
#include<assert.h>
#include<pthread.h>
#include"Log.h"
struct ThreadPool
{
    struct EventLoop* mainloop; //主事件循环
    bool isStart; //子线程池是否开启
    int threadNum; //线程池中线程数量
    struct WorkThread* workThreads; //工作线程
    int index; //工作线程索引
};

// 初始化线程池
struct ThreadPool* ThreadPoolInit(struct EventLoop *mainloop, int threadNum);

// 启动线程池
void ThreadPoolRun(struct ThreadPool* pool);

// 取出线程池中的某个子线程的反应堆实例
struct EventLoop* takeWorkEventLoop(struct ThreadPool* pool);


